home *** CD-ROM | disk | FTP | other *** search
Wrap
cccchhhhmmmmoooodddd((((2222)))) cccchhhhmmmmoooodddd((((2222)))) NNNNAAAAMMMMEEEE _cccc_hhhh_mmmm_oooo_dddd, _ffff_cccc_hhhh_mmmm_oooo_dddd - change mode of file SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_aaaa_tttt_...._hhhh_>>>> _iiii_nnnn_tttt _cccc_hhhh_mmmm_oooo_dddd_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_pppp_aaaa_tttt_hhhh_,,,, _mmmm_oooo_dddd_eeee______tttt _mmmm_oooo_dddd_eeee_))))_;;;; _iiii_nnnn_tttt _ffff_cccc_hhhh_mmmm_oooo_dddd_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _mmmm_oooo_dddd_eeee______tttt _mmmm_oooo_dddd_eeee_))))_;;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _cccc_hhhh_mmmm_oooo_dddd and _ffff_cccc_hhhh_mmmm_oooo_dddd set the access permission portion of the mode of the file whose name is given by _p_a_t_h or referenced by the descriptor _f_i_l_d_e_s to the bit pattern contained in _m_o_d_e. If _p_a_t_h or _f_i_l_d_e_s are symbolic links, the access permissions of the target of the symbolic links are set. Access permission bits are interpreted as follows: _SSSS______IIII_SSSS_UUUU_IIII_DDDD 04000 Set user ID on execution. _SSSS______IIII_SSSS_GGGG_IIII_DDDD 020#0 Set group ID on execution if # is _7777, _5555, _3333, or _1111 Enable mandatory file/record locking if # is _6666, _4444, _2222, or _0000 _SSSS______IIII_SSSS_VVVV_TTTT_XXXX 01000 Save text image after execution (a.k.a. Sticky bit). _SSSS______IIII_RRRR_WWWW_XXXX_UUUU 00700 Read, write, execute by owner. _SSSS______IIII_RRRR_UUUU_SSSS_RRRR 00400 Read by owner. _SSSS______IIII_WWWW_UUUU_SSSS_RRRR 00200 Write by owner. _SSSS______IIII_XXXX_UUUU_SSSS_RRRR 00100 Execute (search if a directory) by owner. _SSSS______IIII_RRRR_WWWW_XXXX_GGGG 00070 Read, write, execute by group. _SSSS______IIII_RRRR_GGGG_RRRR_PPPP 00040 Read by group. _SSSS______IIII_WWWW_GGGG_RRRR_PPPP 00020 Write by group. _SSSS______IIII_XXXX_GGGG_RRRR_PPPP 00010 Execute by group. _SSSS______IIII_RRRR_WWWW_XXXX_OOOO 00007 Read, write, execute (search) by others. _SSSS______IIII_RRRR_OOOO_TTTT_HHHH 00004 Read by others. _SSSS______IIII_WWWW_OOOO_TTTT_HHHH 00002 Write by others _SSSS______IIII_XXXX_OOOO_TTTT_HHHH 00001 Execute by others. Modes are constructed by _OOOO_RRRR_''''_iiii_nnnn_gggg the access permission bits. The effective user ID of the process must match the owner of the file or the process must be super-user to change the mode of a file. If the effective user ID of the process is not super-user, the sticky bit is cleared for any non-directory argument. If the effective group ID of the process does not match the group ID of the file, and the process is not super-user the mode bit 02000 (set group ID on execution) is cleared. If a directory is writable and the sticky bit, _SSSS______IIII_SSSS_VVVV_TTTT_XXXX, is set on the directory, a process may remove or rename files within that directory only if one or more of the following is true [see _uuuu_nnnn_llll_iiii_nnnn_kkkk(2) and _rrrr_eeee_nnnn_aaaa_mmmm_eeee(2)]: PPPPaaaaggggeeee 1111 cccchhhhmmmmoooodddd((((2222)))) cccchhhhmmmmoooodddd((((2222)))) the effective user ID of the process is the same as that of the owner ID of the file the effective user ID of the process is the same as that of the owner ID of the directory the process is a super-user. Note that the group id of the process and file are not taken into account by the rules above. A process will only be able to remove a file in a sticky directory based upon its effective user ID, not its group ID. In releases of IRIX before 6.2, a process could also remove or rename files within a directory with the sticky bit set if the process had write permission for the file. This has been changed in accordance with the X/Open XPG4.2 standard, but the old behavior can be enabled via the xpg4_sticky_bit kernel tunable variable. If the sticky bit, _SSSS______IIII_SSSS_VVVV_TTTT_XXXX, is set on a file that is a dynamic loader for an _E_L_F executable, then when the executable is _e_x_e_ced the old process's read only address spaces will be made available to the dynamic loader in the new process. This can improve program start up time considerably. The setting of the sticky bit on any other file has no effect. If the mode bit 02000 (set group ID on execution) is set, the mode bit 00010 (execute or search by group) is not set, and the file is a regular file, file and record locks will be mandatory. Future calls to _oooo_pppp_eeee_nnnn(2), _cccc_rrrr_eeee_aaaa_tttt(2), _rrrr_eeee_aaaa_dddd(2), and _wwww_rrrr_iiii_tttt_eeee(2) will carry implicit locks, and may fail or block depending on the presence of other locks on the file. Mapped file access is not affected by mandatory locks. If the mode bit 02000 is set on a directory, then any files created in that directory will take on the group ID of the directory rather than the group ID of the calling process. _mmmm_oooo_uuuu_nnnn_tttt(1M) may be used to enable this feature regardless of the mode of the directory. [See _ffff_ssss_tttt_aaaa_bbbb(4)]. Mandatory locking is not supported on NFS or CacheFS. Upon successful completion, _cccc_hhhh_mmmm_oooo_dddd and _ffff_cccc_hhhh_mmmm_oooo_dddd mark for update the _ssss_tttt______cccc_tttt_iiii_mmmm_eeee field of the file. _cccc_hhhh_mmmm_oooo_dddd will fail and the file mode will be unchanged if one or more of the following are true: _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS Search permission is denied on a component of the path prefix of _p_a_t_h. _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS Write permission on the named file is denied. PPPPaaaaggggeeee 2222 cccchhhhmmmmoooodddd((((2222)))) cccchhhhmmmmoooodddd((((2222)))) _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _p_a_t_h points outside the allocated address space of the process. _EEEE_IIII_NNNN_TTTT_RRRR A signal was caught during execution of the system call. _EEEE_IIII_OOOO An I/O error occurred while reading from or writing to the file system. _EEEE_LLLL_OOOO_OOOO_PPPP Too many symbolic links were encountered in translating _p_a_t_h. _EEEE_MMMM_UUUU_LLLL_TTTT_IIII_HHHH_OOOO_PPPP Components of _p_a_t_h require hopping to multiple remote machines and file system type does not allow it. _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG The length of the _p_a_t_h argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or the length of a _p_a_t_h component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while ______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is in effect. _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRR A component of the prefix of _p_a_t_h is not a directory. _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT Either a component of the path prefix, or the file referred to by _p_a_t_h does not exist or is a null pathname. _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK _p_a_t_h points to a remote machine and the link to that machine is no longer active. _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT The named file is located on a remote file system which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)]. _EEEE_PPPP_EEEE_RRRR_MMMM The effective user ID does not match the owner of the file and the process is not super-user. _EEEE_RRRR_OOOO_FFFF_SSSS The file referred to by _p_a_t_h resides on a read-only file system. _ffff_cccc_hhhh_mmmm_oooo_dddd will fail and the file mode will be unchanged if: _EEEE_BBBB_AAAA_DDDD_FFFF _f_i_l_d_e_s is not an open file descriptor _EEEE_IIII_OOOO An I/O error occurred while reading from or writing to the file system. _EEEE_IIII_NNNN_TTTT_RRRR A signal was caught during execution of the _ffff_cccc_hhhh_mmmm_oooo_dddd system call. _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK _f_i_l_d_e_s refers to a remote machine and the link to that machine is no longer active. _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT _f_i_l_d_e_s refers to a file on a remote file system which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)]. PPPPaaaaggggeeee 3333 cccchhhhmmmmoooodddd((((2222)))) cccchhhhmmmmoooodddd((((2222)))) _EEEE_PPPP_EEEE_RRRR_MMMM The effective user ID does not match the owner of the file and the process is not super-user. _EEEE_RRRR_OOOO_FFFF_SSSS The file referred to by _f_i_l_d_e_s resides on a read-only file system. _EEEE_IIII_NNNN_VVVV_AAAA_LLLL The file referred to by _f_i_l_d_e_s resides on NFS or CacheFS and mandatory locking is being enabled. SSSSEEEEEEEE AAAALLLLSSSSOOOO _cccc_hhhh_mmmm_oooo_dddd(1), _aaaa_cccc_cccc_eeee_ssss_ssss(2), _cccc_hhhh_oooo_wwww_nnnn(2), _cccc_rrrr_eeee_aaaa_tttt(2), _eeee_xxxx_eeee_cccc(2), _ffff_cccc_nnnn_tttt_llll(2), _mmmm_kkkk_nnnn_oooo_dddd(2), _oooo_pppp_eeee_nnnn(2), _rrrr_eeee_aaaa_dddd(2), _ssss_tttt_aaaa_tttt(2), _wwww_rrrr_iiii_tttt_eeee(2), _mmmm_kkkk_ffff_iiii_ffff_oooo(3C), _ssss_tttt_aaaa_tttt(5) DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error. BBBBUUUUGGGGSSSS Due to the overloading of various permission bits, the silent turning off of the set group ID on execution bit under the above mentioned circumstances may in fact have disabled mandatory file/record locking (for files) or group inheritance (for directories). The only way to determine if _cccc_hhhh_mmmm_oooo_dddd really worked in these cases is to _ssss_tttt_aaaa_tttt(2) the file. PPPPaaaaggggeeee 4444